1. Field of the Invention
The present invention relates generally to an improved data processing system. More specifically, the present invention is directed to a computer implemented method, system, and computer usable program code for managing a file system within the data processing system.
2. Description of the Related Art
A file system is a mechanism for storing and retrieving files on a hard disc drive. A file system defines the directory structure for keeping track of the files and the path syntax required to access the files. Also, the file system defines the way files are named, as well as the maximum file size. Generally, a file system consists of two distinct parts, a collection of files and a directory structure. Each file in the collection of files stores related data. The directory structure organizes and provides information about the files in the file system.
An important function of a system that supports the file system is backup support. For example, a snapshot function of an operating system maintains a read-only copy that reflects the state of the file system at the point in time the snapshot was created. In particular, a file system snapshot establishes a consistent block level image of the blocks of the file system at a particular point in time. A file system block is a group of data that is transmitted or processed together at the same time. A block may also be referred to as a data block.
The snapshot is used to create backups for an active file system. The snapshot copies modified and deleted blocks, which were in-use in the file system at the point in time the snapshot was created, in order to maintain a point in time image of the file system. As a result, the snapshot may be used to return the file system back to a previous point in time image of the file system. This operation is called a rollback operation.
A file system block that is modified and then released results in the point in time image of the block being copied to a new location by the snapshot, which is a copy on write operation. Then, a snapshot map marks the block as copy on delete when the block is released. When a file system block is unallocated, the block may be reallocated to a different file system object. When a snapshot exists in the file system, itself, the reallocated blocks may be allocated to the snapshot. When the rollback operation is performed, the preserved images of those blocks are copied back to their original location, which results in overwriting the snapshot data before the rollback completes causing data corruption.
Therefore, it would be beneficial to have an improved computer implemented method, system, and computer usable program code for handling reallocated data blocks in a file system during the rollback operation to an internal snapshot to prevent data corruption caused by collision.